export default {
  namespaced: true,
  state: {
    toastshow: false,
    toastmsg: '报错报错',
    toasttype: ''//success danger warning
  },
  mutations: {
    changtoastshow(state, payload) {
      state.toastshow = payload.show;
      state.toastmsg = payload.msg;
      state.toasttype = payload.type;
    }
  },
  actions: {
    asyncChangtoastshow(context, payload) {
      context.commit('changtoastshow', payload);
      setTimeout(() => {
        context.commit('changtoastshow', { show: false })
      }, 2000);
    }
  }
}